Skip to main content
Version: 2.0.0

Basic Setup

Ensure that your application has the following peer dependencies installed:

npm install @mui/material cw/rds @mui/icons-material @reduxjs/toolkit react-redux react-router-dom

Importing Components

WorkForms provides two primary components:

import { FormBuilder, FormGenerator } from '@cw/cherrywork-workforms';

You may also import them individually:

import FormBuilder from '@cw/cherrywork-workforms/FormBuilder';
import FormGenerator from '@cw/cherrywork-workforms/FormGenerator';

Translation Support

To enable translation and multilingual capabilities, install the Work Text library:

npm install @cw/work-text

IDM Support

Global Field Catalog configured in IDM can be used to derive the field properties by choosing a supported field catalog in field settings.

Rules configured in IDM can be used to along with Field Catalogs.

Workforms also provides the IDM admin pannel by installing the below libraries:

npm install @cw/global-field-catalog @cw/idm

Use the gfcFields props to pass the Field Catalogs to be used in the form.

Use idmApplication prop to pass the configured IDM application detail to execute the IDM Rules.

<FormBuilder
...other props
gfcFields={placeholderFieldCatalog}
idmApplication={idmApplicationDetails}
/>

Supported Props

PropertyTypeRequiredDescription
formPropertiesObjectYesForm configuration including formId, formTitle, sourceId, etc.
formHeaderPropertiesObjectNoHeader-level properties like logo, navigation, theme settings
componentsArrayNoPre-built form components/fields
tokenStringYesAuthentication token for API calls
userDetailsObjectYesCurrent user information
destinationsArrayYesAPI destination configurations
isLoadingBooleanYesSet to false initially; required in FormBuilder for Loading state indicator
autoPopulateBooleanNoAuto-populate fields from data source
onSubmitFunctionYesCallback function on form submission
featuresObjectNoFlags for conditional rendering (header bar with save, submit, preview buttons)
useConfigServerDestinationBooleanNoUse configuration server for destinations
signatureConfigObjectNoConfiguration for digital signature
handleClickBackFunctionNoCallback function on back button click in Header
requireAttributeBooleanNoShow/hide DataSet and attribute section; default is false; allows manual dataset/attribute configuration
gfcFieldsArrayNoGlobal field catalogs to be used in form
idmApplicationObjectNoApplication created in IDM